//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.aqgj.pubCode.bean;


import com.aqgj.util.BaseEntity;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Set;

@Entity
@Table(
        name = "PUB_CODE_TABLE_VALUES"
)
@JsonIgnoreProperties({"codeTableValues"})
public class CodeTableValue implements BaseEntity {
    private static final long serialVersionUID = 1L;
    private String id;
    private String name;
    private String value;
    private String sort;
    private String remark;
    private CodeTable codeTable;
    private CodeTableValue codeTableValue;
    private Set<CodeTableValue> codeTableValues;

    public CodeTableValue() {
    }

    @Id
    @GeneratedValue(
            generator = "system-uuid"
    )
    @GenericGenerator(
            name = "system-uuid",
            strategy = "uuid"
    )
    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @ManyToOne(
            fetch = FetchType.EAGER
    )
    @JoinColumn(
            name = "CODE_TABLE_ID"
    )
    public CodeTable getCodeTable() {
        return this.codeTable;
    }

    public void setCodeTable(CodeTable codeTable) {
        this.codeTable = codeTable;
    }

    @ManyToOne(
            fetch = FetchType.EAGER
    )
    @JoinColumn(
            name = "CODE_TABLE_VALUES_ID"
    )
    public CodeTableValue getCodeTableValue() {
        return this.codeTableValue;
    }

    public void setCodeTableValue(CodeTableValue codeTableValue) {
        this.codeTableValue = codeTableValue;
    }

    @Column(
            name = "NAME"
    )
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(
            name = "VALUE"
    )
    public String getValue() {
        return this.value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Column(
            name = "SORT"
    )
    public String getSort() {
        return this.sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    @Column(
            name = "REMARK"
    )
    public String getRemark() {
        return this.remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @OneToMany(
            mappedBy = "codeTableValue",
            cascade = {CascadeType.ALL},
            fetch = FetchType.EAGER
    )
    @OrderBy("sort")
    public Set<CodeTableValue> getCodeTableValues() {
        return this.codeTableValues;
    }

    public void setCodeTableValues(Set<CodeTableValue> codeTableValues) {
        this.codeTableValues = codeTableValues;
    }

    public String toString() {
        return "码表对应的值：" + this.value;
    }
}
